Hello and welcome to this demonstration
on using a do while activity in studio. In this video, you will learn to build
a workflow that will ask the user to input an even number and repetitively asks for input until the number
entered is an even number. So, let's begin. Search for a do while activity in
the activities panel and drag and drop it in the designer panel. Let's rename the sequence as do while and
add an annotation to it. Then rename the do while activity also. The do while activity
will run the loop and execute the statement depending
on the specified condition. Drag and
drop an input dialog activity in the body section of the do while activity and
rename it. In double quotes, enter the title, text,
even number identifier in the dialog title and label text,
enter an even number in the input label. From the variables panel, create a variable called int number, variable type as in 32 and
scope says sequence do while. Navigate to the properties panel
of the input dialog activity and enter the variable,
int number in the result property. Insert, [INAUDIBLE] below the input
dialog activity and rename it. In the condition box, enter,
int number Mod 2 = 0. In the then section, insert a message
box activity and rename it. In double quotes, enter the text,
right, it's an even number. Click show else to view the else
section of the effectivity. In the else section, insert another
message box activity and rename it. In double quotes, enter the text,
it's an odd number, try again. In the condition box of
the do while activity enter int number mod two less than or
greater than zero. Click save to save the project and run it. Enter seven and click Ok. You can see the message,
it's an odd number, try again, click Ok. Now, let's try nine. Since it is also an odd number, you can see the same message again. Now try four and we see the message,
right, it's an even number. This brings us to the end of the video. It is encouraged to build the workflow
as demonstrated and try this activity. Thank you for watching.